import request from '@/util/request'

const timeout = 60 * 1000

export function listWithExplain(data) {
  // let url = '/device/sensor/data/listWithExplain'
  // if (data.startTime && data.startTime < Math.round((new Date().getTime() - 7 * 24 * 60 * 60 * 1000) / 1000)) {
  //   url = 'history/device/sensor/data/listWithExplain'
  // } else if (data.dbType) {
  //   url = 'history/device/sensor/data/listWithExplain'
  // }
  // data.daType = 'taos'
  return request({
    url: '/iot/history/device/sensor/data/listWithExplain',
    method: 'post',
    timeout: timeout,
    data
  })
}

export function deleteData(data) {
  return request({
    url: '/iot/device/sensor/data/delete',
    method: 'post',
    timeout: timeout,
    data
  })
}

